package TransactionImplementation

import (
	"SPC/Database"
	"SPC/ModelImplementation"
	"time"
)

type SalesReceiptTransaction struct {
	itsEmpid int
	itsSalesDate time.Time
	itsAmount float64  
}

func NewSalesReceiptTransaction(saleDate time.Time, amount float64, empid int) *SalesReceiptTransaction{
	return &SalesReceiptTransaction{
		itsSalesDate : saleDate,
		itsAmount : amount,
		itsEmpid : empid,
	}
}

func (s *SalesReceiptTransaction)Execute(){
	e := Database.GetPayrollDatabase().GetEmployee(s.itsEmpid)
	if (e.GetEmpid() != 0){
		//pc := e.GetClassification()
		cc := ModelImplementation.CommissionedClassification{}
		sr := ModelImplementation.SalesReceipt{}
		cc.AddSalesReceipt(sr)
	}
}